<template>
    <ul>
        <li v-for='(item,index) in data' :key='item'>{{item}}  <my-button @click='del(item,index)'>删除</my-button></li>
    </ul>
</template>
<script>
// @ is an alias to /src
export default {
    name: 'XXX',
    props:['data'],
    data() {
        return {
        
        }
    },
    methods: {
      del(item,n){
        console.log(n)
        // this.data.splice(n,1)
        // this.data = this.data.filter(v=>v!=item)
        this.$emit('del',n)
      }
    },
    components: {
        
    }
}
</script>
<style lang="less">

</style>